require 'login_system'
class Plugin::PagelistController < ActionController::Base
  before_filter :set_site_template_root
  def set_site_template_root
    self.class.template_root = "#{RAILS_ROOT}/components/"
    @template.base_path = template_root
  end
  include LoginSystem
  before_filter :login_required, :only => [:config]
  def show
    @pagelist=Media.find(:all,:conditions => "published=1 and type_id=2")
    @plugin=Extplugin.find_by_name("pagelist")
	  @config=@plugin.config 
  	if @plugin.activated==1
  	  render(:layout => false)
  	else
  	  render :text => _("not activated")
  	end
  end
  
	def config
    @plugin=Extplugin.find_by_name("pagelist")
    @config=@plugin.config 
  end
	
end